package fr.uniscol.siecle.model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class Division implements Serializable, DonneeSiecle {
	
	private String code = null;
	
	private String rne = null;
	
	private String libelleLong = null;
	
	private List<MEFAppartenance> appartenancesMefs = null;

	public Division() {
		super();
	}

	public Division(String code, String rne, String libelleLong) {
		super();
		this.code = code;
		this.rne = rne;
		this.libelleLong = libelleLong;
	}

	public String getCode() {
		if(code == null){
			code = "";
		}
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getRne() {
		if(rne == null){
			rne = "";
		}
		return rne;
	}

	public void setRne(String rne) {
		this.rne = rne;
	}

	public String getLibelleLong() {
		if(libelleLong == null){
			libelleLong = "";
		}
		return libelleLong;
	}

	public void setLibelleLong(String libelleLong) {
		this.libelleLong = libelleLong;
	}

	public List<MEFAppartenance> getAppartenancesMefs() {
		if(appartenancesMefs == null){
			appartenancesMefs = new ArrayList<MEFAppartenance>();
		}
		return appartenancesMefs;
	}

	public void setAppartenancesMefs(List<MEFAppartenance> appartenancesMefs) {
		this.appartenancesMefs = appartenancesMefs;
	}

	@Override
	public boolean equals(Object obj) {
		Division d = (Division)obj;
		return getCode().equalsIgnoreCase(d.getCode());
	}

	@Override
	public int hashCode() {
		return super.hashCode();
	}
}
